<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>若梦TV，全网品质好单采集平台</title>
	<meta name="keywords" content="若梦、若梦TV、若梦金冠联盟、采集站、淘客、淘宝客、淘客工具、淘客软件、淘客联盟
">
	<meta name="description" content="若梦TV采集站ruomengtv.com，是若梦金冠联盟优质好单采集平台；专注优质商品，严格把控品质，超高转化，提高收益，为淘客提供最好的商品精选采集平台！">
	<link rel="icon" href="favicon.ico">
	<link rel="stylesheet" type="text/css" href="../../lib/css/animate.min.css">
	<link rel="stylesheet" type="text/css" href="../../layui/css/layer.min.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/jquery.page.min.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/fakeloader.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/reset.css">
	<link rel="stylesheet" type="text/css" href="../../css/comm.css">
	<link rel="stylesheet" type="text/css" href="../../css/data_main.css">
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
	<link rel="stylesheet" type="text/css" href="../../iconfont/iconfont.css">
</head>
<body>
	<!-- 头部 -->
	<header class="header">
		<div class="head">
			<div class="head-left left">
				<a href="index.html" title="若梦TV--首页"><img src="../../img/logo.png" alt=""></a>
				<div class="experience">
					<div class="left">体验</div>
					<div class="right"><a href="http://tool.ruomengtv.com" title="天天赚发单助手" target="_blank">天天赚发单助手</a></div>
				</div>
			</div>
			<!--搜索-->
			<div class="left search-wrap active">
				<div class="left">
					<input type="text" placeholder="输入关键词或商品链接">
					<!--搜索历史-->
					<div class="searchHistory">
						<!-- <div class="historyItem">1</div>
						<div class="historyItem">2</div>
						<div class="historyItem">什么事没事没事</div>
						<div class="historyItem">耐克</div>
						<div class="historyItem">鞋子啊</div> -->
					</div>
					<!--搜索历史结束-->
				</div>
				<div class="right">搜索</div>
			</div>
			<!--搜索结束-->
			<div class="head-right right">
				<div class="left login btn" onclick="location.href='../login/login.html';">登录</div>
				<div class="right register btn" onclick="location.href='../login/regsiter.html';">注册</div>
			</div>
			<!--登录后显示区域-->
			<div class="head-right2 right hide">
				<img class="left releaseIcon" src="../../img/head_icon1.png" title="发布" alt="">
				<img class="left informIcon" src="../../img/head_icon2.png" title="未读消息" alt="">
				<div class="left informNum" title="未读消息">0</div>
				<div class="left headOuter" title="个人中心">
					<img class="headPic" src="../../img/default_head.png" alt="">
				</div>
			</div>
			<!--登录后显示区域结束-->
		</div>
	</header>

	<!--主体内容-->
	<div class="wrap">
		<div class="personalMsg">
			<div class="left leftArea">
				<div class="btn checkManageBtn" onclick="location.href='adminPersonalCenter.html';">审核管理</div>
				<div class="btn" onclick="location.href='adminShelfManage_synthetical.html';">上下架管理</div>
				<div class="btn active" onclick="location.href='adminUserManage.html';">用户管理</div>
			</div>
			<div class="left middleArea">
				<div class="headOuter">
					<img class="icon" src="../../img/default_head.png" alt="">
				</div>
				<div class="nickName"><!-- 管理员昵称 --></div>
				<div class="sign"><!-- 这是一个个性签名哈哈哈哈哈 --></div>
			</div>
			<div class="right rightArea">
				<div class="nums">
					<div class="waitcheck">
						<div class="num checkNum">0</div>
						<div class="text checkText">今日待审核</div>
					</div>
				</div>
				<div class="btn modifyBtn" onclick="popShow('.modifiMsgPop');">修改资料</div>
				<div class="btn modifyPhoneBtn" onclick="popShow('.modifiPhonePop');">更改手机号</div>
				<div class="btn signOutBtn">退出</div>
			</div>
		</div>
		<!--状态类别栏-->
		<div class="statusSorts">
			<span class="btn check active" data-status="">全部<span class="allNum">（0）</span></span>
			<span class="btn passed" data-status="0">正常<span class="normalNum">（0）</span></span>
			<span class="btn repulse" data-status="1">冻结<span class="frozenNum">（0）</span></span>
			<div class="userNum">
				<div class="num">0</div>
				用户量
			</div>
		</div>
		<!--状态类别栏结束-->

		<!--用户搜索框-->
		<div class="userSearchArea">
			<div class="title">搜索提交人</div>
			<div class="searchArea">
				<span>∣</span>
				<input type="text" placeholder="输入手机号或昵称">
			</div>
		</div>
		<!--用户搜索框结束-->

		<!--用户展示区域-->
		<div class="user-wrap">
			<!--添加用户-->
			<div class="user-item addUser">
				<img src="../../img/add_user.png" alt="" onclick="popShow('.addUserPop');">
			</div>
			<!--添加用户结束-->
			<div class="usersArea">
				<!--<div class="user-item userMsg" onclick="location.href='userManageDetails.html';">
					<div class="headArea">
						<div class="headPic">
							<img src="../../img/default_head.png" alt="">
						</div>
						<div class="nickName">张三三</div>
					</div>
					<div class="data">
						<div class="submit">提交：<span>111单</span></div>
						<div class="pass">通过：<span>90单</span></div>
						<div class="point">积分：<span>100</span></div>
					</div>
				</div>-->
			</div>

		</div>
		<!--用户展示区域结束-->

		<!-- 分页 -->
		<div class="page-wrap" style="display: none;">
			<div id="page"></div>
		</div>
		<!--分页结束-->
	</div>

	<!-- 加载层 -->
	<div class="fakeloader"></div>
	<!-- 复制文案 -->
	<div class="copy-data"></div>
	<!-- 返回顶部 -->
	<div class="scrollTop">
		<div class="scrollTop-top">
		</div>
		<div class="scrollTop-bottom">
			返回顶部
		</div>
	</div>

	<!--遮罩层-->
	<div class="grey hide" onclick="popHide();"></div>
	<!--遮罩层结束-->

	<!--修改资料弹窗-->
	<div class="popUp modifiMsgPop hide">
		<div class="titleArea gradient">
			<div class="spaceBox"><!--为防止垂直间距合并--></div>
			<div class="title">修改资料</div>
		</div>
		<div class="contentArea">
			<div class="outer headOuter">
				<label>头像</label>
				<div class="uploadOuter">
					<img id="userImg" src="../../img/head_upload.png" alt="">
					<input type="file" class="addimgIpt" name="file" accept="image/gif,image/jpeg,image/png"/>
				</div>
			</div>
			<div class="outer">
				<label for="nickname">昵称</label>
				<input id="nickname" type="text" maxlength=10 placeholder="请填写昵称">
			</div>
			<div class="outer">
				<label for="sign">个性签名</label>
				<textarea name="" id="sign" maxlength=32 placeholder="请填写个性签名"></textarea>
			</div>
			<div class="outer">
				<label for="phone">手机号</label>
				<input id="phone" type="tel" placeholder="请填写手机号">
			</div>
		</div>
		<div class="btnArea">
			<div class="btn gradient">确定</div>
		</div>
	</div>
	<!--修改资料弹窗结束-->
	
	<!--修改手机号弹窗-->
	<div class="popUp modifiPhonePop hide">
		<div class="titleArea gradient">
			<div class="spaceBox"><!--为防止垂直间距合并--></div>
			<div class="title">修改手机号</div>
		</div>
		<div class="contentArea">
			<div class="outer">
				<span class="oldPhoneOuter">已绑定手机号：</span> <span class="oldPhone"><!-- 1356433290 --></span>
			</div>
			<div class="outer">
				<label for="newPhone">新手机号</label>
				<input id="newPhone" type="tel" placeholder="新手机号">
			</div>
			<div class="outer">
				<label for="imgCode">图片验证码</label>
				<input id="imgCode" type="text" maxlength=4 placeholder="图片验证码">
				<div class="imgVerifiCode"><img src="/user/checkCode" alt=""></div>
			</div>
			<div class="outer">
				<label for="authCode">验证码</label>
				<input id="authCode" type="text" maxlength=6 placeholder="短信验证码">
				<div class="send-code">获取验证码</div>
			</div>
		</div>
		<div class="btnArea">
			<div class="btn gradient">确定</div>
		</div>
	</div>
	<!--修改手机号弹窗结束-->

	<!--新增用户弹窗-->
	<div class="popUp addUserPop hide">
		<div class="titleArea gradient">
			<div class="spaceBox"><!--为防止垂直间距合并--></div>
			<div class="title">创建账户</div>
		</div>
		<div class="contentArea">
			<div class="outer headOuter">
				<label>头像</label>
				<div class="uploadOuter">
					<img src="../../img/head_upload.png" alt="">
					<input type="file" class="addimgIpt layui-upload-file" name="file" accept="image/gif,image/jpeg,image/png"/>
				</div>
			</div>
			<div class="outer">
				<label for="nickname2">昵称</label>
				<input id="nickname2" type="text" placeholder="请填写昵称">
			</div>
			<div class="outer">
				<label for="phone2">手机号</label>
				<input id="phone2" type="tel" placeholder="请填写手机号">
			</div>
			<div class="outer">
				<label for="password">密码</label>
				<input id="password" type="password" placeholder="请填写密码">
			</div>
			<div class="outer">
				<label for="rePassword">确认密码</label>
				<input id="rePassword" type="password" placeholder="请确认密码">
			</div>

		</div>
		<div class="btnArea">
			<div class="btn gradient">确定</div>
		</div>
	</div>
	<!--新增用户弹窗结束-->
</body>

<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.page.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/clipboard.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../layui/lay/dest/layui.all.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../layui/layer.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/fakeloader.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.lazyload.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/md5.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/main.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.hDialog.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/data_main.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/send_code.js"></script>
<script>
var mUsercode = getStorage("usercode");
$( function()
{
	//加载个人信息
	getUserMsg( 2 );

	//加载三个状态的用户数量
	getThreeNum3();

	//默认加载全部第一页用户列表
	get_users( "", 1, "" );

	//切换状态加载相应用户
	$( ".statusSorts .btn" ).click( function()
	{
		$( ".statusSorts .btn" ).removeClass( "active" );
		$( this ).addClass( "active" );
		var status = $( ".statusSorts .btn.active" ).attr("data-status");
		var keyword = $(".userSearchArea input").val();
		get_users( status, 1, keyword );
	} );

	//搜索加载相应用户
	/* document.onkeydown = function(e){
		var ev = document.all ? window.event : e;
		if(ev.keyCode==13) {
			var keyword = $(".userSearchArea input").val();
			var status = $( ".statusSorts .btn.active" ).attr("data-status");
			get_users( status, 1, keyword );
		}
	}; */
	$(".userSearchArea input").bind('input propertychange', function() {
		var keyword = $(this).val();
		var status = $( ".statusSorts .btn.active" ).attr("data-status");
		get_users( status, 1, keyword );
	});

	//创建账户
	$( document ).on( 'click', '.addUserPop .btnArea .btn', function()
	{
		var nickName = $( "#nickname2" ).val();
		var userImg = $( ".addUserPop .uploadOuter img" ).attr( "src" );
		userImg =  userImg== "../../img/head_upload.png" ? "" :userImg;
		var account = $( "#account" ).val();
		var password = $( "#password" ).val();
		var rePassword = $( "#rePassword" ).val();
		var phone = $( "#phone2" ).val();
		if( nickName == "" || nickName.replace( /\s/g, "" ) == "" )
		{
			$.tooltip( '请输入昵称' );
			return;
		}
		if( password == "" || password.replace( /\s/g, "" ) == "" )
		{
			$.tooltip( '请输入密码' );
			return;
		}
		if( password != rePassword )
		{
			$.tooltip( '两次输入的密码不相同' );
			return;
		}
		var isMobile = new RegExp( /^1[34578]\d{9}$/ );
		if( phone == "" || phone.replace( /\s/g, "" ) == "" )
		{
			$.tooltip( '请输入手机号' );
			return;
		}
		if( !isMobile.test( phone ) )
		{
			$.tooltip( '请输入正确的手机号' );
			return;
		}
		var dataJson = {
			"nickname": nickName,
			"password": $.md5( password ),
			"mobile": phone,
			"icon": userImg,
			"mUsercode":mUsercode
		};
		$.ajax( {
			type: 'post',
			url: ajaxUrl + '/user/addUserBymanager',
			data: dataJson,
			beforeSend: function()
			{
				loading( "rgba(0,0,0,0.66)", "spinner1" );
			},
			complete: function()
			{
				loading_success();
			},
			success: function( a )
			{
				console.log( JSON.stringify( a ) );
				if( a.code == 0 )
				{
					popHide();
					layer.msg( "提交成功" );
					//刷新
					var keyword = $(".userSearchArea input").val();
					var status = $( ".statusSorts .btn.active" ).attr("data-status");
					get_users( status, 1, keyword );

				}
				else
				{
					$.tooltip( a.message );
				}
			},
			error: function()
			{
				$.dialog( 'alert', '错误', '服务器走丢了', 1500 );
			}
		} )
	} );

} );

//获取用户
function get_users( status, page, keyword )
{
	
	
	var dataJson = {
		"status": status,//（0 正常 1禁用 2注销）
		"pageIndex": page,
		"keyword": keyword
	};
	console.log(dataJson)
	$.ajax( {
		type: "POST",
		url: ajaxUrl + "/p-info/getuser_all",
		data: dataJson,
		success: function( data )
		{
			console.log( JSON.stringify( data ) );
			if( data.code == 0 )
			{
				var lists = data.data.list;
				if(lists.length !=0){//用户列表不为空
					$(".page-wrap").show();//显示分页
					var result = "";
					$.each( lists, function( i, list )
					{
						var icon = list.icon==undefined || list.icon==""? "../../img/default_head.png":list.icon;
						var nickname = list.nickname;
						var passnum = list.passnum;
						var submitnum = list.submitnum;
						var point = list.point;
						var usercode = list.usercode;
						result += '<div class="user-item userMsg" onclick="location.href=\'userManageDetails.html?usercode=' + usercode + '\';"> ' +
											'<div class="headArea"> ' +
											'<div class="headPic"> ' +
											'<img src="' + icon + '" alt=""> ' +
											'</div> ' +
											'<div class="nickName">' + nickname + '</div> ' +
											'</div> ' +
											'<div class="data"> ' +
											'<div class="submit">提交：<span>' + submitnum + '单</span></div> ' +
											'<div class="pass">通过：<span>' + passnum + '单</span></div> ' +
											'<div class="point">积分：<span>' + point + '</span></div> ' +
											'</div> ' +
											'</div>';
					} );
					result += '<div class="clearfix"></div>';
					$( ".usersArea" ).html( result );
					imgLazyLoad();
					//分页
					$( "#page" ).Page( {
						totalPages: data.data.pageCount,//分页总数
						liNums: 7,//分页的数字按钮数(建议取奇数)
						current: page, //当前页
						activeClass: 'activP', //active 类样式定义
						callBack: function( page )
						{
							$( 'body,html' ).animate( { scrollTop: '400px' }, 500 );
							page++;
							get_users( status, page, keyword );
						}
					} );
				}else{//无用户
					$( ".usersArea" ).html( "" );
					$(".page-wrap").hide();//隐藏分页
				}

			}else{
				$.tooltip( data.message );
			}
		},
		error: function( data )
		{
			$.dialog( 'alert', '错误', '服务器走丢了', 1500 );
		}
	} );
}


</script>
</html>



